package com.ymatou.iapi.productmanager.service;

import java.util.List;

import com.google.common.reflect.TypeToken;
import com.ymatou.iapi.productmanager.parameter.GrouponProductListDto;
import com.ymatou.iapi.productmanager.parameter.ProductListDto2;
import com.ymt.base.YmatouBaseCall;
import com.ymt.core.tool.FormatUtil;
import com.ymttest.utils.EnvSetup;
/**
*查询商品列表
*FreeMaker Template自动生成代码
*/
public class GetByProductIdListCall extends YmatouBaseCall{
	private static String opurl ="api/sellerproduct/GetByProductIdList";
	
	public GetByProductIdListCall() {
		super(EnvSetup.getSystemUrl("productmanager"),opurl,"POST","JSON");
	}
	@Override
	public void addDefHeader() {
		client.addHeader("Accept","text/xml,text/javascript,text/html,application/json");
		client.addHeader("Content-Type", "application/json; charset=UTF-8");
	}
	public List<ProductListDto2> getProductList(){
		String ProductList=getJsonObject().get("Data").getAsJsonObject().get("ProductList").getAsJsonArray().toString();
		List<ProductListDto2> GrouponProductListDtoList=(List<ProductListDto2>) FormatUtil.GSONToObject(ProductList, new TypeToken<List<ProductListDto2>>(){}.getType());
		return GrouponProductListDtoList;
	}
}